#{extends 'main.html' /}
#{set title:'Create Request' /}

#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/datepicker.css'}">
#{/set}

#{set 'moreScripts'}
<script src="@{'/public/javascripts/datepicker.js'}" type="text/javascript" charset="${_response_encoding}"></script>
<script src="@{'/public/javascripts/create-offer.js'}" type="text/javascript" charset="${_response_encoding}"></script>
#{/set}

<div id="main" style="padding-top:0px">
  <div class="post" style="padding:top:0px">
    <h3 style="padding-top:0px;">Create New Request</h3>
    <p>Use the form below to create a new request.</p>
    <!-- <p class="hata"> Errors looks like this. Something went terribly wrong! Nuclear explosion warning!</p> -->
    <!-- <p class="ikaz">Warning. Please be a kind girl!</p> -->
    <!-- <p class="tamam">Hey, we did it!</p> -->
    <!-- <p class="bilgi"> here comes info. Very informative!!!</p> -->
    <form action="@{Application.doCreateRequestItem()}" method="POST" class="utility_form">

      <fieldset>
        <legend>Descriptions</legend>
        
        <ul>
	  <input type="hidden" name="requestItem.userEmail" value="${user.email}" />
          <li>
	    #{error 'requestItem.title' /}
            <label>Title</label>
            <input type="text" name="requestItem.title" value="${flash['requestItem.title']}" />
          </li>
          <li>
	    #{error 'requestItem.tags' /}
            <label>Tags</label>
            <input type="text" name="requestItem.tags" value="${flash['requestItem.tags']}" />
          </li>
          <li>
	    #{error 'requestItem.description' /}
            <label>Description</label>
            <textarea name="requestItem.description">${flash['requestItem.description']}</textarea>
          </li>
        </ul>
      </fieldset>
      
      <fieldset>
        <legend>Limitations</legend>
        <ul>
	  <!--          <li>
			<label>Attendee Number</label>
			<select name="attendee_number">
			  <option value="1">1</option>
			  <option value="2">2</option>
			  <option value="3">3</option>
			  <option value="4">4</option>
			  <option value="5">5</option>
			  <option value="6-10">6-10</option>
			  <option value="10-20">10-20</option>
			  <option value="20-50">20-50</option>
			  <option value="50-100">50-100</option>
			  <option value="100+">100+</option>
			</select>
          </li>-->
          
          <li>
	    #{error 'requestItem.endDate' /}
            <label>Valid Until</label>
            <input type="text" name="requestItem.endDate" class="date_pick" value="${flash['requestItem.endDate']}" />
          </li>
          
	  <!--          <li>
			<label>Location</label>
			<select name="city">
			  <option value="1">List of Cities</option> 
			</select>
			<select name="town">
			  <option value="1">List of town</option> 
			</select>
			<select name="district">
			  <option value="1">List of district</option> 
			</select>
          </li>-->
        </ul>
        
      </fieldset>
      
      <fieldset>
        <legend>Photos</legend>
        <ul>
          <li>
            <label>Photo</label>
            <input type="file" name="photo" />
          </li>
          <li>
            <label>Added Photos</label>
            <div class="photos">
              <img src="@{'public/images/icons/user.png'}" />
              <img src="@{'public/images/icons/user.png'}" />
            </div>
          </li>
        </ul>
      </fieldset>
      
      <input type="submit" value="OK. Create!" />

    </form>
    
  </div>

</div>
